$(function() {
	$('a').on('click', function(e) {
		e.preventDefault()
		e.stopPropagation();
		$('form').attr('method', 'POST');
		$('form').form('submit', {
			url: config['LOGIN_URL'],
			success: function(data) {
				var parsedData = $.parseJSON(data);
				if (parsedData.succeeded) {
					console.log(config['HOME_URL']);
					window.location.href = config['HOME_URL'];
				} else {
					$.messager.alert('Prompt', 'Error: ' + parsedData.message);
				}
			},

		});
	});
});